1. Field of the Invention
The present invention relates to an image processing apparatus and method, and a program. The invention particularly relates to an image processing apparatus and method, and a program with which a high quality panoramic image can be obtained.
2. Description of the Related Art
Up to now, a technique of generating a panoramic image by overlapping and synthesizing a plurality of still images picked up by a camera-integrated digital VCR or the like is proposed (for example, see Japanese Unexamined Patent Application Publication No. 2003-198902). As the panoramic image is an image obtained by disposing and synthesizing the plurality of still images, with the panoramic image, it is possible to display a wider area as a subject than an area on a space which is an image pickup target at a time that one still image is picked up.
Also, as a method of deciding a seam between the still images when a composition of the still images is carried out, a method of utilizing a solution for the shortest path problem in graph theory is proposed (for example, see Takeaki IIYOSHI, Wataru MITSUHASHI, “Image mosaic generation method for panoramic image creation” Image Lab, June 2008 issue, Japan Industrial Publishing Co., Ltd., published on 5 Aug. 2008, pp. 6-11).
According to this method, for example, as illustrated in FIG. 1, a seam SJ located in an overlapping area of two adjacent still image I(t) and still image I(t+1) is decided. It should be noted that in FIG. 1, the horizontal direction and the vertical direction respectively denote an x direction and a y direction, and the still image I(t) and the still image I(t+1) are overlapped and disposed on an xy coordinate system. Also, coordinates on four corners of the overlapping area are set as “(Qx0, Qy0), (Qx0, Qy1), (Qx1, Qy0), and (Qx1, Qy1)”.
In the example of FIG. 1, from cost values calculated in the overlapping area of the still image I(t) and the still image I(t+1), the seam SJ having a minimum cost is calculated. To be more specific, a two-dimensional graph is generated while a high cost is set for a moving subject on the still image and in contrast, a low cost is set for a stationary subject, and the seam SJ having the minimum cost is decided. Therefore, the seam SJ is obtained where the moving subject on the still image is not divided.
When the seam SJ is calculated, a part from an end on the left side of the still image I(t) to an area in the vicinity of the seam SJ and a part from an area in the vicinity of the seam SJ of the still image I(t+1) to a right end of the still image I(t+1) are synthesized to generate a panoramic image.
By calculating the seam SJ and synthesizing the respective still images in this manner, the images are connected at positions where the seam of the images is not conspicuous, and it is possible to obtain a higher quality panoramic image.